
<table style='width: 100%'>
<tr>
<td valign='top'>

<div class="content">
<span class="contentTitle"> Lista korisnika </span>
<table class='tableResult' style="width: 100%">
<tr><th scope='col'> <b> Ime </b> </th> 
	<th scope='col'> <b> Username </b> </th> 
	<th scope='col'> <b> Prava </b> </th> 
</tr>
<?php 
	$query = "SELECT * FROM korisnik;";
	$result = myQuery($query);
	
	while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
		if ($row['prava'] == 1) $prava = "Administrator";
		else $prava = "Korisnik";
		print("<tr>" . 
		"<td> " . $row['ime'] . " " . $row['prezime'] . "</td>" .
		"<td> " . $row['username'] . "</td>" .
		"<td> " . $prava . "</td>" .
		"<td width='16px'> <a title='Pobriši korisnika' href='exec/admin.php?action=delete&type=korisnik&id=" . $row['id'] . "'> 
					<img src='/images/delete.png' width='16px' height='16px'> </td>");
	}
?>
</table>
</div> <br>
</td>

<td valign='top'>
<div class="content">
<span class="contentTitle"> Novi korisnik </span>
<form action="../exec/admin.php?action=new&type=korisnik" method="POST">
	<table class='tableResult'>
	<tr><th scope='row' class='spec' width='100px'> Ime </th> 
		<td> <input type="text" name="korisnikIme" id="noviKorisnikIme"></td></tr>
	<tr><th scope='row' class='spec'> Prezime </th> 
		<td> <input type="text" name="korisnikPrezime" id="noviKorisnikPrezime"></td></tr>
	<tr><th scope='row' class='spec'> Username </th> 
		<td> <input type="text" name="korisnikUsername" id="noviKorisnikUsername"></td></tr>
	<tr><th scope='row' class='spec'> Password </th> 
		<td> <input type="password" name="korisnikPassword" id="noviKorisnikPassword"></td></tr>
	<tr><th scope='row' class='spec'> Password<br>repeat </th> 
		<td> <input type="password" name="korisnikPasswordRpt" id="noviKorisnikPasswordRpt"></td></tr>
	<tr><th scope='row' class='spec'> <input type='submit' value="Dodaj korisnika"> </th> 
		<td> <input type='checkbox' name="korisnikPrava" id="noviKorisnikPrava"> Administrator</td></tr>
	</table>
</form>
</div><br>

</td>
</tr>
</table>





